package com.xqq.controller;

import com.xqq.utils.CoordinateTransformer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CoordinateController {

    @GetMapping("/convert/gcj02-to-wgs84")
    public String convertGcj02ToWgs84(@RequestParam String coordinates) {
        try {
            return CoordinateTransformer.transformCoordinates(coordinates);
        } catch (IllegalArgumentException e) {
            return "错误: " + e.getMessage();
        }
    }
}
